package top.oylan.mp.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.oylan.mp.entity.Menu;
import top.oylan.mp.entity.User;
import top.oylan.mp.entity.example.UserExample;
import top.oylan.mp.entity.vo.Admin;
import top.oylan.mp.utils.Pager;

import java.util.List;

@Mapper
public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User findUser(UserExample userExample);

    List<Admin> selectAdminByPager(Pager<Admin> pager);

    List<Menu> selectPromisedMenus(@Param("userId") Integer userId);
}